﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Final_Project
{
    public partial class CGui : Form
    {
        public CKinectMngr m_cKinectMngr = null;

        public CGui()
        {
            m_cKinectMngr = new CKinectMngr();
            m_cKinectMngr.SetCGui(this);
            InitializeComponent();
        }

        private void cGui_Shown(Object sender, EventArgs e)
        {
            if (null != m_cKinectMngr)
            {
                m_cKinectMngr.StartSensor();
            }
        }

        private void btStart_Click(object sender, System.EventArgs e)
        {
            m_cKinectMngr.Start();
        }

        private void btStop_Click(object sender, System.EventArgs e)
        {
            m_cKinectMngr.Stop();
        }

        private void btExit_Click(object sender, System.EventArgs e)
        {
            if (null != m_cKinectMngr)
            {
                m_cKinectMngr.StopSensor();
            }
            this.Close();
        }

        public void UpdatePictureBox(Bitmap cBmp)
        {
            pbImage.Image = cBmp;
        }

    }
}
